package com.service.impl;

import com.entity.User;
import com.mapper.RegisterMapper;
import com.service.RegisterService;
import com.util.AjaxResult;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.Date;
import java.util.List;

@Service
public class RegisterServiceImpl implements RegisterService {

    @Autowired
    RegisterMapper registerMapper;

    @Override
    public User addRegister(User user) {
        return registerMapper.registerAdd(user);
    }

    @Override
    public String checkNameService(String login_name) {
//        if(login_name.matches("^[0-9a-zA-Z_]{1,}$")){
//            return registerMapper.checkNameMapper(login_name);
//        }
        return registerMapper.checkNameMapper(login_name);
    }

    @Override
    public boolean checkEmailService(String email) {
        boolean flag=false;
        String s = registerMapper.checkEmailMapper(email);
        if (s!=null){
            flag=true;
        }
        return flag;
    }
}
